package com.qst.service.impl;

import com.qst.service.*;

import java.util.HashMap;
import java.util.Map;

public class ServiceFactory {
    private static Map<Class, Object> services = new HashMap<>();
    static {
        services.put(UserService.class, new UserServiceImpl());
        services.put(TestPersonnelService.class, new TestPersonnelServiceImpl());
        services.put(UserAdminService.class, new UserAdminServiceImpl());
        services.put(AssessmentService.class, new AssessmentServiceImpl());
        services.put(DimensionService.class, new DimensionServiceImpl());
        services.put(QuestionService.class, new QuestionServiceImpl());
        services.put(ScheduleService.class, new ScheduleServiceImpl());
        services.put(TeamService.class, new TeamServiceImpl());
        services.put(ExamService.class, new ExamServiceImpl());
    }

    public static<T> T getService(Class<T> clazz) {
        return (T)services.get(clazz);
    }
}
